$.fn.lunboY = function (obj) {
        var box1 = obj.ulId ? document.getElementById(obj.ulId) : 0;
        var spanParent = obj.indexParentId && obj.indexActiveClass ? document.getElementById(obj.indexParentId) : 0;
        var span = spanParent.children ||0;
        console.log(span)
        obj.speed = obj.speed || 2000;
        var btn_left = obj.btn_leftId ? document.getElementById(obj.btn_leftId) : 0;
        var btn_right = obj.btn_rightId ? document.getElementById(obj.btn_rightId) : 0;
        if (box1!=0) {
            var width_c = box1.children[0].offsetWidth;
            var width_p = box1.offsetWidth - width_c;
        }

        clearInterval(obj.timeID2)
        var spanllength;
        if (span != 0) {
            var active = obj.indexActiveClass;
            spanllength = span.length;
            for (var j = 0; j < span.length; j++) {
                span[j].setAttribute("index", "" + j);
                span[j].onmouseover = function () {
                    var p = this.getAttribute("index");
                    // 把index传递出去
                    index1 = index2 = p;
                    if (box1!=0) {
                        time(box1, -p * width_c);
                    }
                    removeSpanClass()
                    this.setAttribute("class", active)
                }
            }
        } else {  
            spanllength = box1.children.length - 1;
        }
        var index1 = 0, index2 = 0;
        if (btn_left != 0 && btn_right != 0) {
            btn_right.onclick = function () {
                play()
            }
            btn_left.onclick = function () {
                index1--;
                index2--;
                if (index1 < 0 && box1!=0) {
                    index1 = spanllength - 1;
                    box1.style.left = -width_p + "px"
                }
                if (index2 < 0) {
                    index2 = spanllength - 1;
                }
                if (span != 0) {
                    removeSpanClass();
                    span[index2].setAttribute("class", active)
                }
                if (box1!=0) {
                    time(box1, -index1 * width_c);
                }
            }
        }
        obj.timeID2 = setInterval(play, obj.speed);
        function play() {
            index1++;
            if (index1 > spanllength &&box1!=0) {
                index1 = 1;
                box1.style.left = "0px"
            }
            if (span != 0) {
                index2++;
                if (index2 >= spanllength) {
                    index2 = 0;
                }
                removeSpanClass();
                span[index2].setAttribute("class", active)
            }
            if (box1!=0) {
                time(box1, -index1 * width_c);
            }
        }
        if (box1 !=0) {
            box1.onmouseover = function () {
                clearInterval(obj.timeID2)
            }
            box1.onmouseout = function () {
                obj.timeID2 = setInterval(play, obj.speed);
            }
        }
        function removeSpanClass() {
            for (var i = 0; i < span.length; i++) {
                span[i].removeAttribute("class");
            }
        }
        function time(ele, position) {
            clearInterval(ele.timeID1);
            ele.timeID1 = setInterval(function () {
                var of = ele.offsetLeft;
                var step = 5;
                // 如果给定的位置小于现在的位置,则步长为 -5
                step = of > position ? -step : step
                ele.style.left = (of + step) + "px";
                if (Math.abs(of - position) < step) {
                    clearInterval(ele.timeID1);
                    ele.style.left = position + "px"
                }
            }, 1)
        }
    }